﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;
using BLL;

public partial class Hoso_HosoQuantridoipass : System.Web.UI.Page
{
    TAIKHOANBLL tkbll = new TAIKHOANBLL();
    THANHVIENBLL tvbll = new THANHVIENBLL();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["tenthanhvien"] == null) Response.Redirect("../LogIn.aspx");
        MultiView1.SetActiveView(View1);
    }
   
    protected void Button1_Click1(object sender, EventArgs e)
    {
        MultiView1.SetActiveView(View1);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        MultiView1.SetActiveView(View2);
    }
    public void showMessage(string mess)
    {
        string strBuilder = "<script language='javascript'>alert('" + mess + "')</script>";
        Response.Write(strBuilder);
    } 
    protected void Button3_Click(object sender, EventArgs e)
    {
        if (Session["password"].ToString() != txtpass.Text)
        {
           // Label5.Visible = true;
           // Label5.Text = "Không đúng Password !";
            showMessage("Không đúng PassWord !");
        }
        if (Session["password"].ToString() == txtpass.Text && txtpassdoi.Text == txtpassdoire.Text)
        {
            tkbll.update_pass(txtpassdoi.Text, Session["tentaikhoan"].ToString());
           
           // Label4.Visible = true;
            //Label4.Text = "Đã sửa thành công !";
            showMessage("Đã sửa thành công !");
        }
        
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        if (txtemail.Text == txtemailre.Text)
        {
            tvbll.Update_email(txtemailre.Text, Session["tentaikhoan"].ToString());
            showMessage("Đã sửa thành công !");
            //  Label3.Visible = true;
            //  Label3.Text = "Đã sửa thành công !";
        }
        else {
            showMessage("Nhập lại Email !");
        }
    }
}
